import React from "react";

export type CurrentKey =
  | "main" // 首页
  | "question"
  | "anomaly"
  | "param"
  | "path"
  | undefined;

export interface IBigScreenContext {
  currentKey: CurrentKey;
  setCurrentKey: (currentKey: CurrentKey) => void;
  clientWidth: number;
  iframeRef: React.RefObject<HTMLIFrameElement> | undefined;
  postMessageApi: any;
  chatFull: boolean;
  setChatFull: (target: boolean) => void;
  chartFull: boolean;
  setChartFull: (target: boolean) => void;
  setPathJson: (target: any) => void;
  chatRef: React.RefObject<any> | undefined;
  currentDevice: string;
  currentPathDevice: string;
  setCurrentDevice: (value: string) => void;
  setCurrentPathDevice: (value: string) => void;
  pathJson: any;
  anomalyJson: any;
  setAnomalyJson: (target: any) => void;
  paramJson: any;
  setParamJson: (target: any) => void;
  navList: string[];
  setNavList: (target: string[]) => void;
  initNavList: () => void;
  activeTab: string;
  setActiveTab: (tab: string) => void;
  shouldKeepZIndex: boolean;
  setShouldKeepZIndex: (target: boolean) => void;
}

export const BigScreenContext = React.createContext<IBigScreenContext>({
  currentKey: "main",
  setCurrentKey: () => {},
  clientWidth: 0,
  iframeRef: undefined,
  postMessageApi: undefined,
  chatFull: false,
  setChatFull: () => {},
  chartFull: false,
  setChartFull: () => {},
  shouldKeepZIndex: false,
  setShouldKeepZIndex: () => {},
  chatRef: undefined,
  pathJson: {},
  anomalyJson: {},
  paramJson: {},
  setPathJson: (info: any) => {},
  currentDevice: "all",
  currentPathDevice: "all",
  setCurrentDevice: (value: string) => {},
  setCurrentPathDevice: (value: string) => {},
  setAnomalyJson: (info: any) => {},
  setParamJson: (info: any) => {},
  navList: [],
  setNavList: (info: any[]) => {},
  initNavList: () => {},
  activeTab: "裂解炉",
  setActiveTab: () => {},
});
